package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MenuDao;
import com.itheima.pojo.Menu;
import lombok.extern.slf4j.Slf4j;
import org.apache.zookeeper.data.Id;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Set;

@Service
@Slf4j
public class MenuServiceImpl implements  MenuService{

    @Autowired
    MenuDao menuDao;

    @Override
    public Set<Menu> findAll() {
        Set<Menu> menus = menuDao.findAll();
        return menus;
    }

    /*根据角色id查找对应的权限的所有id*/
    @Override
    public Set<Integer> findMenusByRoleId(int rid) {
        Set<Integer> menuIds = menuDao.findMenuByRoleId2(rid);
        return menuIds;
    }
}
